<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>伪元素层叠</title>
    <style>
        div {
            display: flex;
            width: 100%;
            height: 100vh;
            background-color: chartreuse;
        }
        img {
            flex: 1;
            /* object-fit: cover; */
        }
        section{
            flex: 1;
            background-color: blueviolet;
        }
        a {
            flex: 1;
            background-color: brown;
        }
        input{
            flex: 1;
        }
    </style>
</head>
<body>
    <p>问题描述：当img设置flex:1并且有兄弟元素时，无效。图片还是按照原始宽度展示；</p>
    <p>解决：可以给img套上一个元素再设置flex:1，然后img 宽度设置为100%</p>
    <div>
        <img src="../images/艺术理念.jpg" alt="">
        <!-- <a href="">A标签</a> -->
        <!-- <input type="text">  -->
        <section></section>
    </div>
</body>
</html>